/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.wj.school.server;

import cn.wj.school.common.controller.StageController;
import cn.wj.school.common.enums.UiFactory;
import cn.wj.school.server.net.ServerNet;
import cn.wj.school.server.ui.view.StageView;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * 服务端
 * @author lidapeng
 */
public class ServerApp extends Application{

    public static void main(String[] args) throws Exception {
        new ServerNet(args.length > 0 ? Integer.valueOf(args[0]) : null);
        launch(args);
    }

    @Override
    public void start(Stage stage) throws Exception {
        StageController stageController = UiFactory.INSTANCE.getStageController();
        stageController.loadStage(StageView.id.MAIN_VIEW, StageView.layout.MAIN_VIEW,
                StageStyle.UNDECORATED);
        stageController.setStage(StageView.id.MAIN_VIEW);
    }
}
